﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="MaterialStore.aspx.cs" Inherits="RN.ERP.Web.Material.Material.MaterialStore" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript">
        function ShowMaterial(obj) {
            var cid = $(obj).attr("cid");
            $.ligerDialog.open({ url: "MaterialStoreAddMate.aspx?c=" + cid, width: 600, height: 600, title: '选择物资', isResize: true });
            return false;
        }
        function OnClientCloseMate(args) {
            var arg = args;
            if (arg) {
                $("#ContentPlaceHolder1_gvMaterial_hdnMCode_" + (arg.cid - 1)).val(arg.mcode);
                $("#ContentPlaceHolder1_gvMaterial_Label2_" + (arg.cid - 1)).val(arg.mname);
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hdnSelectControl" runat="server" ClientIDMode="Static" />
    <div id="layout" style="margin: 2px; margin-right: 3px;">
        <div class="xian">
            <div class="about_title">
                物资管理</div>
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td width="1%" class="title_lbg IE6png">
                </td>
                <td width="2%" class="title_t IE6png">
                </td>
                <td width="96%" class="title_libg IE6png">
                </td>
                <td width="1%" class="title_rbg IE6png">
                </td>
            </tr>
            <tr id="tbCorp" runat="server">
                <td class="border_lbg IE6png">
                    &nbsp;
                </td>
                <td colspan="2" style="padding-top: 16px; padding-left: 6px; padding-right: 6px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab" style="margin-bottom: 15px;">
                        <tr>
                            <td width="130" bgcolor="#f2f2f2">
                                <strong>上级单号</strong>
                            </td>
                            <td style="text-align: left;" colspan="3">
                                <asp:TextBox ID="txtName" runat="server" Width="60%" CssClass="rn-input-text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td width="130" bgcolor="#f2f2f2">
                                <strong>票据单号</strong>
                            </td>
                            <td style="text-align: left" colspan="3">
                                <asp:TextBox ID="TextBox1" runat="server" Width="60%" CssClass="rn-input-text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#f2f2f2">
                                <strong>单据价值总价</strong>
                            </td>
                            <td style="text-align: left" colspan="3">
                                <asp:TextBox ID="TextBox2" runat="server" Width="60%" CssClass="rn-input-text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#f2f2f2">
                                <strong>备注</strong>
                            </td>
                            <td style="text-align: left" colspan="3">
                                <asp:TextBox ID="txtAreMemo" runat="server" TextMode="MultiLine" Width="50%" Height="100px"
                                    CssClass="rn-input-text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td bgcolor="#f2f2f2">
                                <strong>物资信息</strong>
                            </td>
                            <td style="text-align: left" colspan="3">
                                <asp:Button ID="btnAdd" runat="server" Text="添加物资信息" CssClass="btn-blue" OnClick="btnAdd_Click" />
                                <asp:GridView ID="gvMaterial" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
                                    AutoGenerateEditButton="True" CellPadding="4" ForeColor="#333333" GridLines="None"
                                    OnRowCancelingEdit="gvMaterial_RowCancelingEdit" OnRowDeleting="gvMaterial_RowDeleting"
                                    OnRowEditing="gvMaterial_RowEditing" OnRowUpdating="gvMaterial_RowUpdating">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="序号">
                                            <EditItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Index") %>'></asp:Label>
                                                <input id="hdnCCode" type="hidden" cid='<%# "c"+Eval("Index") %>' runat="server"
                                                    value='<%# Bind("CCode") %>' />
                                                <input id="hdnMCode" type="hidden" cid='<%# "m"+Eval("Index") %>' runat="server"
                                                    value='<%# Bind("MCode") %>' />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Index") %>'></asp:Label>
                                                <input id="hdnCCode" type="hidden" cid='<%# "c"+Eval("Index") %>' runat="server"
                                                    value='<%# Bind("CCode") %>' />
                                                <input id="hdnMCode" type="hidden" cid='<%# "m"+Eval("Index") %>' runat="server"
                                                    value='<%# Bind("MCode") %>' />
                                            </ItemTemplate>
                                            <HeaderStyle Wrap="False" />
                                            <ItemStyle Width="30px" Wrap="False" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="物资名称">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="Label2" runat="server" Enabled="false" Text='<%# Bind("MName") %>'></asp:TextBox>
                                                <asp:LinkButton ID="lb2" runat="server" cid='<%# Eval("Index") %>' OnClientClick="return ShowMaterial(this);"
                                                    Text="选择物资" ForeColor="White"></asp:LinkButton>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("MName") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle Width="200px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="仓库名称">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="Label3" runat="server" Enabled="false" Text='<%# Bind("CName") %>'></asp:TextBox>
                                                <asp:LinkButton ID="lb3" runat="server" Text="选择仓库" ForeColor="White"></asp:LinkButton>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("CName") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle Width="200px" />
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="数量" DataField="Num">
                                            <ItemStyle Width="150px" />
                                        </asp:BoundField>
                                        <asp:BoundField HeaderText="单价" DataField="Price">
                                            <ItemStyle Width="150px" />
                                        </asp:BoundField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: left" colspan="4">
                                <center>
                                    <asp:Button ID="btnSave" runat="server" CssClass="btn-blue" Text="入库" OnClick="btnSave_Click" /></center>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="border_rbg IE6png">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="border_lconer IE6png" headers="17">
                    &nbsp;
                </td>
                <td colspan="2" class="border_bottomli IE6png" height="17">
                    &nbsp;
                </td>
                <td class="border_rconer IE6png" headers="17">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
